<template>
  <el-form ref="form" :model="lh" label-width="40px">
		<el-form-item label="行高 ">
		  <el-input v-model.number="lh.lineHeight" type="number" placeholder="请输入" clearable @change="handleChange"></el-input>
		</el-form-item>
	</el-form>
</template>
<script>

export default {
  name: 'UILineHeight',
  props: {
    value: {
      type: Object,
      required: true
    }
  },
  data () {
    const lh = this.value
    return {
      lh: {
        lineHeight: lh.h
      }
    }
  },
	watch:{
		value(new_val,old_val){
			this.lh.lineHeight=new_val.h
		}
	},
  methods: {
    handleChange () {
      const lh = this.lh
      this.$emit('change', {
        key: 'lh',
        value: {
          h: lh.lineHeight
        }
      })
    }
  }
}
</script>

<style>
	input::-webkit-outer-spin-button,
    input::-webkit-inner-spin-button {
        -webkit-appearance: none;
    }
    input[type="number"]{
        -moz-appearance: textfield;
    }
</style>
